package com.lwj.vo.administration;

import com.lwj.utils.BuildTreeBean;

import java.util.ArrayList;
import java.util.List;

public class DepartmentTreeVo implements BuildTreeBean {
    private String departmentId;

    /**
     * 上级部门id
     */
    private String parentDepartmentId;

    /**
     * 部门名称
     */
    private String name;

    /**
     * 部门类型
     */
    private String type;
    /**
     * 部门状态
     */
    private String status;

    private Integer level;
    /**
     * 是否是基层 true:不是基层不能设置人员
     */
    private boolean noBasic;

    public boolean isNoBasic() {
        return noBasic;
    }

    public void setNoBasic(boolean noBasic) {
        this.noBasic = noBasic;
    }

    public Integer getLevel() {
        return level;
    }

    public void setLevel(Integer level) {
        this.level = level;
    }

    private List<DepartmentTreeVo> children;

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public List<DepartmentTreeVo> getChildren() {
        return children;
    }

    public void setChildren(List<DepartmentTreeVo> children) {
        this.children = children;
    }

    public String getDepartmentId() {
        return departmentId;
    }

    public void setDepartmentId(String departmentId) {
        this.departmentId = departmentId;
    }

    public String getParentDepartmentId() {
        return parentDepartmentId;
    }

    public void setParentDepartmentId(String parentDepartmentId) {
        this.parentDepartmentId = parentDepartmentId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }
    public void addChildren(DepartmentTreeVo departmentTreeVo){
        if(this.children==null){
            this.children=new ArrayList<>();
        }
        this.children.add(departmentTreeVo);
    }

    @Override
    public List children() {
        if(this.children==null){
            this.children=new ArrayList<>();
        }
       return this.children;
    }

    public String id(){
        return getDepartmentId();
    }
    public String parentId(){
        return getParentDepartmentId();
    }
}
